﻿@page "/Account/Callback"
@inject IJSRuntime JSRuntime;
@layout EmptyLayOut
@inject NavigationManager NavigationManager;
@inject AuthenticationStateProvider authProvider
<h3>Callback</h3>

@code {
    protected override async Task OnInitializedAsync()
    {
        Console.WriteLine("callback");
        var res =  await JSRuntime.InvokeAsync<bool>("callback");
        if (res.Equals(true))
        {
            ((CustomAuthStateProvider)authProvider).MarkUserAsAuthenticated();
            NavigationManager.NavigateTo("/");
        }
    }
}
